package com.ivo.biz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ivo.core.hibernate.HibernateInvoker;

/**
 * 
 *
 * @author Minkey Wang
 * @version 2017年7月27日
 */
@Service
public class RuleService {

    @Autowired
    private HibernateInvoker hibernateInvoker;
    
	public Rule getRule(Double score) {
		String hql ="select r from Rule r where r.isValid is true and r.minAmount<= ?0 and r.maxAmount>= ?1" ;
		return (Rule) hibernateInvoker.findUnique(hql, score,score);
	}

}
